/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.cms.template.entity;

import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.core.persistence.DataEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 模板Entity
 *
 * @author Sawyer
 * @version 2020-12-21
 */
@ToString
@Getter
@Setter
public class CmsTemplate extends DataEntity<CmsTemplate> {

    private static final long serialVersionUID = 1L;

    /**
     * 模板中文名称
     */
    @Length(min = 2, max = 32, message = "模板中文名称长度必须介于 2 和 32 之间")
    @ExcelField(title = "模板中文名称", align = 2, sort = 1)
    private String name;

    /**
     * 英文名称
     */
    @Length(min = 2, max = 64, message = "英文名称长度必须介于 2 和 64 之间")
    @ExcelField(title = "英文名称", align = 2, sort = 2)
    private String enname;

    /**
     * 模板类型,CSS、JAVASCRIPT、HTML、FTL
     */
    @NotBlank(message = "模板类型不能为空")
    @ExcelField(title = "模板类型,CSS、JAVASCRIPT、HTML、FTL", align = 2, sort = 3)
    private String type;

    /**
     * 模板内容
     */
    @ExcelField(title = "模板内容", align = 2, sort = 4)
    private String content;

    public CmsTemplate() {
        super();
        this.setIdType(IDTYPE_AUTO);
    }

    public CmsTemplate(String id) {
        super(id);
    }
}
